<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //rest 剩余参数
        //1.可以收集剩余所有的参数
        //2.可以解构
        function fn(a,b,c,d,e){
            console.log(a);
            console.log(b);
            console.log(c);
            console.log(d);
            console.log(e);
        }
        fn(1,2,3,4,5);
        var arr = [1,2,3,4,5];
        fn(...arr); //解构
    </script>
</body>
</html>